﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ProgrammingEducationSystem.Models
{
    //班级
    public class Class
    {
        public Guid Id { get; set; }

        [Required(ErrorMessage = "班级名称不可为空")]
        public string Name { get; set; }

        [ForeignKey(nameof(User))]
        [Required(ErrorMessage = "教师Id不可为空")]
        public string TeacherId { get; set; }
        public User Teacher { get; set; }

        public List<Course>? courses {get;set;}
    }
}
